home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 484 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  3.1 KB

  1. Path: chronicle.mti.sgi.com!austern
  2. From: girod@dshp01.trs.ntc.nokia.com (Marc Girod)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Anyone considered inheritable friendship?
  5. Date: 15 Feb 1996 09:16:41 PST
  6. Organization: Nokia Telecommunications
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <1yvil99bwv.fsf@dshp01.trs.ntc.nokia.com>
  9. References: <AFVop7nqs7@qsar.chem.msu.su> <4fnrfr$7b1@engnews1.Eng.Sun.COM>
  10. Reply-To: Marc Girod <girod@trshp.trs.ntc.nokia.com>
  11. NNTP-Posting-Host: isolde.mti.sgi.com
  12. Content-Type: text/plain; charset=ISO-8859-1
  13. Content-Transfer-Encoding: 8bit
  14. X-Original-Date: 15 Feb 1996 11:27:12 +0200
  15. In-Reply-To: clamage@Eng.Sun.COM's message of 12 Feb 1996 10:24:02 PST
  16. X-Attribution: MG
  17. X-Newsreader: Gnus v5.1
  18. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  19.     iQBVAwUBMSNqoEy4NqrwXLNJAQHc4gH/Yl2WXZA9tetHlRRu6WusKhJJiiTUH2jR
  20.     wajIVOkvOKexE0Gf8N8ULvaROeZWw9PBP/Q5blGOfo5G/3g5WcGc2w==
  21.     =cI5B
  22. Originator: austern@isolde.mti.sgi.com
  23.  
  24. >>>>> "SC" == Steve Clamage <clamage@Eng.Sun.COM> writes:
  25.  
  26. SC> In article AFVop7nqs7@qsar.chem.msu.su, "Eugene Radchenko" <eugene@qsar.chem.msu.su> writes:
  27. >> Has anyone proposed/considered the inheritable friendship in addition to
  28. >> the current one?
  29.  
  30. SC> I don't see much difference between allowing friendship to be inherited
  31. SC> and making all class members public. The purpose of access control is
  32. SC> not to hide implementation details from other programmers, because it
  33. SC> does not do that. The purpose is more to prevent other parts of the
  34. SC> program from depending on implementations details as opposed to depending
  35. SC> only on the public interface.
  36.  
  37. I do not support Eugene's proposal (friendship granted to a class
  38. _and classes derived from it_), but I have a problem with your
  39. argumentation.
  40.  
  41. IMHO, you make an assumption (commonly made) about the use of access
  42. control beyond its "objective" semantics. Namely, access control is
  43. often used to separate "interface" from "implementation".
  44.  
  45. Well, this view is problematic:
  46.  
  47. - There is an other way to support this separation in C++, inheritance
  48.   from abstract classes. This other way is sufficient, and far
  49.   superior: as you note, access control does not hide the
  50.   implementation; inheritance does, and therefore guarrantees that
  51.   clients of abstract interfaces do not depend on the implementation.
  52. - Friendship may still be used in abstract interfaces to support
  53.   interface dedication. This is useful, and not supported in any other
  54.   way by the language.
  55.  
  56. Best Regards!-- 
  57. +---------------------------------------------------------------------------+
  58. | Marc Girod - Nokia Telecommunications     Phone: +358-0-511 27703         |
  59. | Kilo RD 4 - P.O. Box 12                     Fax: +358-0-511 27432         |
  60. | SF-02611 Espoo 61 - Finland            Internet: marc.girod@ntc.nokia.com |
  61. |        X.400: C=FI, A=Elisa, P=Nokia Telecom, SUR=Girod, GIV=Marc         |
  62. +---------------------------------------------------------------------------+
  63. ---
  64. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  65.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  66.   in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html. ]
  67.